package com.epi.controller;

import com.epi.basic.model.ResponseVO;
import com.epi.domain.dto.UserLoginReq;
import com.epi.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dxy
 * @version 1.0
 */
@RestController
public class LoginController {
    @Autowired
    LoginService loginService;

    @PostMapping("/auth/login")
    public ResponseVO login(@RequestBody UserLoginReq request) {
        return loginService.login(request);
    }

    @GetMapping("/auth/logout")
    public ResponseVO logout() {
        return loginService.logout();
    }
}
